<!DOCTYPE html>
<html style="font-size: 50px;">

<head>
  <meta http-equiv="X-UA-Compatible" content="content-type" charset="utf-8" />
  <meta name="apple-mobile-web-app-capable" content="yes" />
  <meta name="apple-touch-fullscreen" content="yes" />
  <meta name="format-detection" content="telephone=no" />
  <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  <meta name="format-detection" content="telephone=no" />
  <meta name="msapplication-tap-highlight" content="no" />
  <meta name="viewport" content="initial-scale=1,maximum-scale=1,minimum-scale=1" />
  <link rel="stylesheet" href="index.css">
  <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
  <meta http-equiv="Pragma" content="no-cache" />
  <meta http-equiv="Expires" content="0" />
  <script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
  <!-- <script type="text/javascript" src="../js/jquery/jquery.min.js"></script> -->
  <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js" type="text/javascript"></script>
  <title>2022挖贝网北交所·新三板年终评选</title>
</head>
</head>
<style>
  [v-cloak] {
    display: none;
  }

</style>

<body>
  <div id="app">
    <div data-v-3840e446="" class="vux-header" style="background-color: rgb(0, 0, 0);">
      <div class="vux-header-left"><a class="vux-header-back"></a>
        <div class="left-arrow"></div>
      </div>
      <h1 class="vux-header-title"><span @click="toIndex">返回首页</span></h1>
      <div class="vux-header-right">
      </div>
    </div>
    <div class="company-detail">
      <div class="company-banner">
        <img src="http://files.wabei.cn/2022Vote/bannerV3-index.png" alt="">
      </div>
      <div class="company-introduction clearfix">
        <div class="fl">
          <h2>{{company.stockName}}<span>（{{company.stockCode}}）</span></h2>
          <div>
            {{company.introduction}}
          </div>
          <div class="lable">
            <button v-for="(item,key) in company.tags" :key="key">
              {{item}}
            </button>
          </div>
        </div>
      </div>
      <div class="person clearfix">
        <div :class="item.projectID==1?'zhengshu fl':'company zhengshu fl'" v-for="(item,key) in prizeList" :key="key">
          <div class="company-img">
            <img :src="item.ceoImage" v-if="item.ceoImage && item.projectID==1" alt="">
            <img :src="item.projectImage=='http://files.wabei.cn/2022VoteV2/5.png'?'http://files.wabei.cn/2022VoteV2/5_v3.png':item.projectImage" v-else-if="item.projectImage && item.projectID!=1" alt="">
            <img v-else style="margin-top:-20px;" src="http://files.wabei.cn/img/touxiang.png" alt="">
          </div>
          <div class="to-vote">
            <div class="tops" style="display: flex;align-items: center;font-size:0.26rem;">
              <div class="rate">
                <p>排名</p>
                <p class="rate-number">
                  {{item.ranking}}
                </p>
              </div>
              <div class="qiye-type" style="line-height: 1;">
                {{item.projectName}}
              </div>
            </div>

            <div class="vote-number" style="font-size:0.26rem;">
              <span>投票数:<span class="red">{{item.votes}}</span></span>
              <span @click="toVote(item.projectID,key,item.pollID)">投票</span>
            </div>
          </div>
        </div>
      </div>
      <div class="comment">
        <button class="contact-btn" @click="showContact">
          联系企业
        </button>
      </div>
      <div>
      </div>
    </div>
    <div>
      <div class="activity-description">
        <!-- 评选流程 -->
        <div>
          <h4>
            评选流程
          </h4>
          <img class="liucheng" src="http://files.wabei.cn/2022Vote/step3.png" alt="">
        </div>
        <!-- 投票说明 -->
        <div>
          <h4>
            投票说明
          </h4>
          <p>每个微信号每日最多可投5票</p>
          <p>最终评选结果由评审团根据评审团及网络票选综合决定</p>
          <p class="strong">投票截止日期：2023年1月3日</p>
        </div>
        <!-- 活动合作 -->
        <div class="clearfix">
          <h4>
            活动合作
          </h4>
          <div class="fl cooperation">
            <p v-for="(item,key) in cooperation" :key="key">
              <span class="person">
                <img :src="item.icon" alt="">
              </span>
              {{item.contactWay}}
            </p> 
          </div>
          <div class="fr cooperation">
            <button @click="signUp()">参与评选</button>
          </div>
        </div>
        <!-- 支持媒体
        <div v-for="(item,index) in picList" :key="index">
          <h4>
            {{item.name}}
          </h4>
          <div class="media clearfix">
            <div v-for="(pics,key) in item.arr" :key="key">
              <img :src="pics" alt="">
            </div>
          </div>
        </div> -->
      </div>
      <footer>
        <div class="footer-common ">
          <div class="wrapper ">
            <p>
              <a href="http://www.wabei.cn/about/aboutus.html">关于我们</a><i class="sep ">┊</i>
              <a href="http://www.wabei.cn/about/links.html">友情链接</a><i class="sep ">┊</i>
              <a href="http://www.wabei.cn/about/joinus.html">加入我们</a><i class="sep ">┊</i>
              <!--<a href="http://info.wabei.cn/ ">新三板公告</a><i class="sep ">┊</i>-->
              <a href="http://www.wabei.cn/roll/index.html">实时更新</a><i class="sep ">┊</i>
              <a href="http://www.wabei.cn/yc/index.html">原创报道</a>
            </p>
            <p class="contact-way">
              <span>服务电话：15810423576</span>
              &nbsp;
              <span>微信公众号：挖贝网</span>
            </p>
            <p class="m0">挖贝网是新三板专业门户，新三板生态价值发现平台，</p>
            <p class="m0">新三板大数据平台开创及领导者</p>
            <p class="m0">WaBei.CN © 2007-2016 京ICP备11034405号 </p>
            <p class="m0">京公网安备110105010276</p>

          </div>
        </div>
      </footer>
    </div>
    <div>
      <div class="vux-x-dialog dialog-demo" v-cloak v-show="show">
        <div class="weui-mask"></div>
        <div class="weui-dialog">
          <div class="img-box contact-company">
            <div class="vux-modal-header"><span class="vux-close-btn" @click="show=false">×</span></div>
            <div class="info-form">
              <p>如实填写信息，我们稍后为您推荐企业</p>
              <div class="recommen-info">
                <input placeholder="姓名" v-model="formVal.Name" />
                <input placeholder="职位" v-model="formVal.Duty" />
                <input placeholder="公司" v-model="formVal.Company" />
                <input placeholder="手机号码" v-model="formVal.Cellphone" />
                <input placeholder="微信/QQ" v-model="formVal.WxQQ" />
                <input placeholder="需求" v-model="formVal.Request" />
                <button type="primary" @click="submit()">提交</x-button>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="vux-x-dialog dialog-demo" v-cloak v-show="isShowBaoming">
      <div class="weui-mask"></div>
      <div class="weui-dialog">
        <div class="img-box contact-company">
          <div class="vux-modal-header"><span class="vux-close-btn" @click="isShowBaoming=false">×</span></div>
          <div class="info-form">
            <div class="recommen-info">
              <input placeholder="姓名" v-model="formVal2.name" />
              <input placeholder="职位" v-model="formVal2.duty" />
              <input placeholder="手机号码" v-model="formVal2.cellphone" />
              <div class="company-list">
                <input placeholder="股票简称 / 代码" @blur="loseFocus" @keyup="searchCompany" v-model="companyName" />
                <ul class="search_list" v-if="companyData && companyData.length>0">
                  <li v-for="(item,key) in companyData" :key="key" @click="addCompany(item.companyName,item.stockCode)">
                    {{item.companyName}}({{item.stockCode}})</li>
                </ul>
              </div>
              <div class="join-list">
                <p>参选奖项</p>
                <div>
                  <input type="checkbox" v-model="checklistDongshi">北交所·新三板杰出董事长
                </div>
                <select v-model="checklist">
                  <option v-for="(item,idx) in title" :key="idx" :value="item.key">{{item.value}}</option>
                </select>
                <button type="primary" button-primary-bg-color="red" @click="submit2()">提交</button>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="msg" v-cloak v-show="ifShow">
      {{msg}}
    </div>
    <div class="weui-toast" v-show="showLoading"><i class="weui-loading weui-icon_toast"></i>
      <!---->
    </div>
  </div>
</body>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="index.js"> </script>
<script>
  new Vue({
    el: '#app',
    name: "index",
    data() {
      return {
        showLoading: true,
        isChecked: false,
        isShowBaoming: false,
        companyData: [], //通过股票代码简称拼音查询公司列表
        companyName: "",
        flag: 0, //标记被点击的是否是下面的列表，1是，0不是
        commenPath: Vue.prototype.commenPath,
        show: false,
        msg: "",
        ifShow: false,
        formVal2: {
          name: "",
          duty: "",
          cellphone: "",
          wxQQ: "",
          stockCode: "",
          projects: []
        },
        title: [{
          key: -1,
          value: "请选择参选行业奖"
        }, {
          key: 2,
          value: "高新技术领军企业"
        }, {
          key: 3,
          value: "现代服务领军企业"
        }, 
        // {
        //   key: 4,
        //   value: "数字营销领军企业"
        // },
         {
          key: 5,
          value: "新一代信息技术领军企业"
        }, 
        // {
        //   key: 7,
        //   value: "消费升级领军企业"
        // },
         {
          key: 8,
          value: "智能制造领军企业"
        }, {
          key: 10,
          value: "医疗健康领军企业"
        }, {
          key: 11,
          value: "能源环保领军企业"
        }],
        cooperation: [{
          "icon": "http://files.wabei.cn/img/person.png",
          "contactWay": "李先生"
        }, {
          "icon": "http://files.wabei.cn/img/phone.png",
          "contactWay": "158-1042-3576"
        }, {
          "icon": "http://files.wabei.cn/img/open_email.png",
          "contactWay": "liyongqiang@wabei.cn"
        }], //合作人员信息
        picList: [{
          name: "战略合作媒体",
          arr: [
            "http://files.wabei.cn/img/logo-01.jpg",
            "http://files.wabei.cn/img/logo-02.jpg",
            "http://files.wabei.cn/img/logo-03.jpg"
          ]
        }, {
          name: "战略支持媒体",
          arr: [
            "http://files.wabei.cn/img/logo-05.jpg",
            "http://files.wabei.cn/img/logo-14.jpg",
            "http://files.wabei.cn/img/logo-37.jpg"
          ]
        }, {
          name: "官方合作媒体",
          arr: [
            "http://files.wabei.cn/img/logo-15.jpg",
            "http://files.wabei.cn/img/logo-17.jpg",
            "http://files.wabei.cn/img/logo-20.jpg",
            "http://files.wabei.cn/img/logo-38.jpg",
            "http://files.wabei.cn/img/logo-45.png"
          ]
        }, {
          name: "合作支持媒体",
          arr: [
            "http://files.wabei.cn/img/logo-07.jpg",
            "http://files.wabei.cn/img/logo-09.jpg",
            "http://files.wabei.cn/img/logo-10.jpg",
            "http://files.wabei.cn/img/logo-11.jpg",
            "http://files.wabei.cn/img/logo-12.jpg",
            "http://files.wabei.cn/img/logo-13.jpg",
            "http://files.wabei.cn/img/logo-16.jpg",
            "http://files.wabei.cn/img/logo-18.jpg",
            "http://files.wabei.cn/img/logo-19.jpg",
            "http://files.wabei.cn/img/logo-22.jpg",
            "http://files.wabei.cn/img/logo-23.jpg",
            "http://files.wabei.cn/img/logo-25.jpg",
            "http://files.wabei.cn/img/logo-26.jpg",
            "http://files.wabei.cn/img/logo-27.jpg",
            "http://files.wabei.cn/img/logo-28.jpg",
            "http://files.wabei.cn/img/logo-29.jpg",
            "http://files.wabei.cn/img/logo-30.jpg",
            "http://files.wabei.cn/img/logo-31.jpg",
            "http://files.wabei.cn/img/logo-32.jpg",
            "http://files.wabei.cn/img/logo-33.jpg",
            "http://files.wabei.cn/img/logo-34.jpg",
            "http://files.wabei.cn/img/logo-35.jpg",
            "http://files.wabei.cn/img/logo-36.jpg",
            "http://files.wabei.cn/img/logo-40.jpg",
            "http://files.wabei.cn/img/logo-41.jpg",
            "http://files.wabei.cn/img/logo-43.jpg",
            "http://files.wabei.cn/img/logo-44.png",
            "http://files.wabei.cn/img/logo-46.jpg",
            "http://files.wabei.cn/img/logo-47.png",
            "http://files.wabei.cn/img/logo-48.jpg",
          ]
        }],
        show: false,
        rate: 0,
        titleDongshi: [{
          key: 1,
          value: "北交所·新三板杰出董事长"
        }],
        checklist: -1, //企业报名
        checklistDongshi: false, //董事长报名
        formVal: {
          Name: "",
          Duty: "",
          Company: "",
          Cellphone: "",
          WxQQ: "",
          Request: "",
          StockCode: ""
        },
        company: {
          stockName: "",
          stockCode: "",
          introduction: "",
          tags: []
        },
        prizeList: []
      };
    },
    methods: {
      loseFocus() {
        var that = this
        that.companyData = []
        // setTimeout(() => {
        //   if (that.flag !== 1) {

        //   }
        // }, 200);
      },
      searchCompany() {
        var that = this
        console.log(that.companyName)
        if (!that.companyName) {
          return
        }
        getData("/vote/stock/" + that.companyName, "", function (res) {
          var data = res
          that.companyData = data.data
        }, function (res) {
          console.log(res)
        })
      },
      addCompany(name, code) {
        this.flag = 1
        this.formVal2.stockCode = code
        this.companyName = name
      },
      toIndex() {
        window.location.href = "/index.html"
      },
      signUp() {
        this.isShowBaoming = true
      },
      submit2() { //提交年终评选
        var that = this
        if (!that.formVal2.name) {
          that.toast('请输入姓名！', 'middle')
          return
        }
        if (!that.formVal2.duty) {
          that.toast('请输入职位！', 'middle')
          return
        }
        if (!that.formVal2.cellphone || that.formVal2.cellphone == "") {
          that.toast('请输入手机号码！', 'middle')

          return
        }
        if (!(/^1(1|2|3|4|5|6|7|8|9)\d{9}$/.test(that.formVal2.cellphone))) {
          that.toast('手机号码格式有误，请重填！', 'middle')
          return
        }
        if (!that.formVal2.stockCode) {
          that.toast('请从列表中选择股票代码/简称！', 'middle')
          that.companyName = ""
          return
        }
        that.formVal2.projects = []
        if (that.checklistDongshi == true && that.checklist != -1) {
          that.checklistDongshi = 1
          that.formVal2.projects = that.formVal2.projects.concat(that.checklistDongshi, that.checklist)
          for (var i = 0; i < that.formVal2.projects.length; i++) {
            that.formVal2.projects[i] = {
              "ID": that.formVal2.projects[i]
            }
          }
        } else if (that.checklistDongshi == true && that.checklist == -1) {
          that.formVal2.projects = [{
            "ID": 1
          }]
        } else if (that.checklistDongshi == false && that.checklist != -1) {
          that.formVal2.projects = [{
            "ID": that.checklist
          }]
        } else {
          that.toast('请选择参选奖项！', 'middle')
          return
        }

        if (that.formVal2.projects.length <= 0) {
          that.toast('请选择参选奖项！', 'middle')
          return
        }
        this.putData("/vote/register/", that.formVal2, function (res) {
          var data = res
          if (data.code == 0) {
            that.toast('提交成功！', 'middle')
            for (var k in that.formVal2) {
              if (k == "duty") {
                that.formVal2[k] = ""
              } else if (k == "projects") {
                that.formVal2[k] = []
              } else {
                that.formVal2[k] = ""
              }
              that.companyName = ""
              that.checklist = -1
              that.checklistDongshi = false
            }
          } else {
            that.toast(data.message, 'middle')
          }
        }, function (res) {
          console.log(res)
        })
      },
      submit() {
        var that = this;
        if (!that.formVal.Name) {
          that.toast("请输入姓名！", "middle");
          return;
        }
        if (!that.formVal.Company) {
          that.toast("请输入公司名称！", "middle");
          return;
        }
        if (!that.formVal.Cellphone) {
          that.toast("请输入手机号码！", "middle");
          return;
        }
        if (!/^1(1|2|3|4|5|6|7|8|9)\d{9}$/.test(that.formVal.Cellphone)) {
          that.toast("手机号码格式有误，请重填！", "middle");
          return;
        }
        if (!that.formVal.Request) {
          that.toast("请输入需求！", "middle");
          return;
        }
        that.formVal.StockCode = that.prizeList[0].stockCode;
        this.putData("/vote/contact", that.formVal, function (res) {
          var data = res;
          if (data.code == 0) {
            that.toast("提交成功！", "middle");
            that.show = false;
          } else {
            that.toast(data.message, "middle");
          }
        }, function (res) {
          console.log(res);
        })
      },
      showContact() {
        var that = this;
        for (var key in that.formVal) {
          that.formVal[key] = "";
        }
        that.show = true;
      },
      toast(msg) {
        var that = this;
        this.ifShow = true
        this.msg = msg
        setTimeout(function () {
          that.ifShow = false
        }, 2000)
      },
      loadCompanyDetail() {
        var that = this;
        var idx = this.GetQueryString("codes");
        getData("/vote/polls/0/" + idx + "/details", "", function (res) {
          if (res.code == 0) {
            var data = res;
            that.company = data.data[0];
            that.company.tags =
              data.data[0].tags.length > 0 && data.data[0].tags.split(",");
            if (data.data.length == 2) {
              if (data.data[0].projectID == 1) {
                that.prizeList = [data.data[1], data.data[0]];
              } else {
                that.prizeList = [data.data[0], data.data[1]];
              }
            } else {
              that.prizeList = data.data;
            }
            //加载分享到微信 
            that.shareWx();
            //处理董事长名称
          } else {
            that.toast(data.message, "middle");
          }
        }, function (res) {
          console.log(console.log(res))
        })
      },
      toVote(idx, k1, pollID) {
        //奖项编号
        if (!idx) {
          return;
        }
        var that = this;
        postData("/vote/vote/" + pollID + "/" + that.getCookie("accesskey"), "", function (res) {
          var data = res;
          // debugger
          if (data.code !== 0) {
            that.toast(data.message, "middle");
          } else {
            var votes = that.getCookie("votes") - 0;
            if (votes < 4) {
              that.setCookie("votes", votes + 1, "24:00:00");
              that.toast(
                "投票成功,今天还可投" + (5 - (that.getCookie("votes") - 0)) + "票",
                "middle"
              );
              that.prizeList[k1].votes++;
            } else if (votes == 4) {
              that.setCookie("votes", votes + 1, "24:00:00");
              that.toast("投票成功,今天的票数已经投完啦！", "middle");
              that.prizeList[k1].votes++;
            } else {
              that.toast("今天的票数已经投完啦,明天再来呦！", "middle");
            }
          }
        }, function () {
          that.toast("出错啦", "middle");
        })
      },
      getData(cName, isAsync, sCallback, eCallback) {
        var url = commenPath + cName;
        $.ajax({
          async: isAsync,
          url: url,
          dataType: "json",
          type: 'GET',
          success: function (res) {
            sCallback(res);
          },
          error: function (a, b, c) {
            eCallback(a, b, c);
          }
        });
      },
      putData(cName, pData, sCallback, eCallback) {
        var url = commenPath + cName;
        $.ajax({
          url: url,
          headers: {
            "Content-Type": "application/json",
            "X-HTTP-Method-Override": "PUT"
          },
          type: 'PUT',
          data: JSON.stringify(pData),
          success: function (res) {
            sCallback(res);
          },
          error: function (a, b, c) {
            eCallback(a, b, c);
          }
        });
      },
      postData(cName, pData, sCallback, eCallback) {
        var url = commenPath + cName;
        $.ajax({
          url: url,
          dataType: "json",
          type: "POST",
          data: pData,
          success: function (res) {
            sCallback(res);
          },
          error: function (a, b, c) {
            eCallback(a, b, c);
          }
        });
      },
      shareWx() {
        var url = window.location.href.toLowerCase();
        var that = this
        postData2("http://vote.wabei.cn/vote/sign/url", url, function (res) {
          var data = res
          if (data.code == 0) {
            //微信分享功能
            var wxShare = new WxShare({
              share_title: "请投我一票：" + that.company.stockName + "(" + that.company.stockCode + ")" +
                "正在参与2022北交所·新三板年终评选",
              share_url: url,
              share_desc: "",
              share_imgurl: "http://files.wabei.cn/img/logo.png",
              appId: "wx031005fc43335c2b",
              timestamp: "1414587457",
              nonceStr: "psKNy1oqeud0v",
              signature: data.data
            });
            wxShare.config();

          }
          that.showLoading = false
        }, function (res) {
          that.showLoading = false
        })
      },
      getCookie(c_name) {
        if (document.cookie.length > 0) {
          var c_start = document.cookie.indexOf(c_name + "=")
          if (c_start != -1) {
            c_start = c_start + c_name.length + 1
            var c_end = document.cookie.indexOf(";", c_start)
            if (c_end == -1) c_end = document.cookie.length
            return unescape(document.cookie.substring(c_start, c_end))
          }
        }
        return ""
      },
      setCookie(c_name, value, expiredays) {
        // 获取当前日期对象
        var curDate = new Date();
        // 获取当前日期对应的时间戳
        var curTime = curDate.getTime();
        // 获取指定时间的时间戳
        var endTime = this.convertTime(curDate, expiredays);
        // 计算出指定时间与当前时间的时间差
        var disTime = endTime - curTime;
        // 设置cookie过期时间
        var exp = new Date();
        exp.setTime(endTime); //过期时间
        document.cookie = c_name + "=" + escape(value) +
          ((expiredays == null) ? "" : ";expires=" + exp.toGMTString())
      },
      convertTime(nowDate, Deadline) {
        // 分割参数Deadline
        var _dateArr = Deadline.split(':');
        // 分别获取参数中对应的时、分、秒
        var hours = parseInt(_dateArr[0]);
        var minutes = parseInt(_dateArr[1]);
        var seconds = parseInt(_dateArr[2]);
        // 设置对应时分秒
        nowDate.setHours(hours);
        nowDate.setMinutes(minutes);
        nowDate.setSeconds(seconds);
        // 获取当前天中指定时分秒对应的毫秒数
        var result = Date.parse(nowDate);
        return result;
      },
      getExpireTime() {
        var date = new Date();
        var hour = 23 - date.getHours();
        var min = 59 - date.getMinutes();
        var ms = (3600 * hour + 60 * min) * 1000;
        return ms;
      },
      valid() {

        var key = getCookie("accesskey")
 
        var that = this
        if (!key) {
          if (this.GetQueryString("state") == "login") {
            postData("/vote/vote/login/" + that.GetQueryString("code"), "", function (res) {
              if (res.code == 0) {
                var data1111 = res.data
                setCookie("accesskey", data1111)
                that.fun();
              } else {
                alert(data.message + "请关闭页面重新打开")
              }
            }, function (res) {
              console.log(res)
            })
          } else {
            window.location.href =
              "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx031005fc43335c2b&redirect_uri=" + window
              .location.href + "&response_type=code&scope=snsapi_base&state=login#wechat_redirect"
          }
        } else {
          that.fun();
        }
      },
      fun() {
        if (window.location.href.indexOf("state=login") !== -1) {
          window.location.href = window.location.href.substr(0, window.location.href.indexOf("&code="));
        } else {
          new WxShare() //微信分享
          this.loadCompanyDetail()
        }
      },
      GetQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return unescape(r[2]);
        return null;
      }
    },
    created() {
      this.show = false
      this.msg = "";
      this.ifShow = false;
    },
    mounted() {
      this.valid(); //验证登录
      // this.loadCompanyDetail(); //加载公司详情
    }
  })

</script>

</html>
